home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / Prog / M / LSC213.cpt / Quickdraw.h < prev    next >
Encoding:
C/C++ Source or Header  |  1987-09-26  |  3.2 KB  |  205 lines  |  [TEXT/KAHL]

  1.  
  2. /*
  3.  *  Quickdraw.h
  4.  *
  5.  *  Copyright (c) 1986, 1987 THINK Technologies, Inc.
  6.  *  These interfaces are based on information copyrighted
  7.  *  by Apple Computer, Inc., 1985, 1986, 1987.
  8.  *
  9.  */
  10.  
  11. #ifndef    _Quickdraw_
  12. #define _Quickdraw_
  13.     
  14. #ifndef    _MacTypes_
  15. #include "MacTypes.h"
  16. #endif
  17.  
  18.  
  19. /*  transfer modes */
  20. enum {
  21.     srcCopy,
  22.     srcOr,
  23.     srcXor,
  24.     srcBic,
  25.     notSrcCopy,
  26.     notSrcOr,
  27.     notSrcXor,
  28.     notSrcBic,
  29.     patCopy,
  30.     patOr,
  31.     patXor,
  32.     patBic,
  33.     notPatCopy,
  34.     notPatOr,
  35.     notPatXor,
  36.     notPatBic
  37. };
  38.  
  39. /* colors */
  40. #define    blackColor        33
  41. #define    whiteColor        30
  42. #define    redColor        205
  43. #define    greenColor        341
  44. #define    blueColor        409
  45. #define    cyanColor        273
  46. #define    magentaColor    137
  47. #define    yellowColor        69
  48.  
  49. /* standard picture comments */
  50. enum { picLParen, picRParen };
  51.  
  52. /* color mapping */
  53. enum {
  54.     normalBit,
  55.     inverseBit,
  56.     blueBit,
  57.     greenBit,
  58.     redBit,
  59.     blackBit,
  60.     yellowBit,
  61.     magentaBit,
  62.     cyanBit
  63. };
  64.  
  65. typedef    char QDByte, *QDPtr, **QDHandle;
  66.  
  67. typedef enum {
  68.     bold = 1,
  69.     italic = 2,
  70.     underline = 4,
  71.     outline = 8,
  72.     shadow = 16,
  73.     condense = 32,
  74.     extend = 64
  75. } Style;
  76.  
  77. typedef    enum { frame, paint, erase, invert, fill } GrafVerb;
  78.  
  79. typedef unsigned char Pattern[8];
  80. typedef Pattern *PatPtr, **PatHandle;
  81.  
  82. typedef int    Bits16[16];
  83.  
  84. typedef    struct    
  85.     {
  86.     int        ascent;
  87.     int        descent;
  88.     int        widMax;
  89.     int        leading;
  90.     } FontInfo;
  91.     
  92. typedef    struct    
  93.     {
  94.     QDPtr    baseAddr;
  95.     int        rowBytes;
  96.     Rect    bounds;
  97.     } BitMap;
  98.     
  99. typedef    struct
  100.     {
  101.     Bits16    data;
  102.     Bits16    mask;
  103.     Point    hotSpot;
  104.     } Cursor, *CursPtr, **CursHandle;
  105.     
  106. typedef    struct    
  107.     {
  108.     Point    pnLoc;
  109.     Point    pnSize;
  110.     int        pnMode;
  111.     Pattern    pnPat;
  112.     } PenState;
  113.  
  114. typedef    struct
  115.     {
  116.     int        polySize;
  117.     Rect    polyBBox;
  118.     Point    polyPoints[];
  119.     } Polygon, *PolyPtr, **PolyHandle;
  120.  
  121. typedef    struct    
  122.     {
  123.     int        rgnSize;
  124.     Rect    rgnBBox;
  125.     } Region,* RgnPtr,** RgnHandle;
  126.  
  127.  
  128. typedef    struct    
  129.     {
  130.     int        picSize;
  131.     Rect    picFrame;
  132.     } Picture, *PicPtr, **PicHandle;
  133.  
  134. typedef    struct    
  135.     {
  136.     QDPtr    textProc;
  137.     QDPtr    lineProc;
  138.     QDPtr    rectProc;
  139.     QDPtr    rRectProc;
  140.     QDPtr    ovalProc;
  141.     QDPtr    arcProc;
  142.     QDPtr    polyProc;
  143.     QDPtr    rgnProc;
  144.     QDPtr    bitsProc;
  145.     QDPtr    commentProc;
  146.     QDPtr    txMeasProc;
  147.     QDPtr    getPicProc;
  148.     QDPtr    putPicProc;
  149.     } QDProcs,* QDProcsPtr;
  150.  
  151. typedef    struct    GrafPort
  152.     {
  153.     int            device;
  154.     BitMap        portBits;
  155.     Rect        portRect;
  156.     RgnHandle    visRgn;
  157.     RgnHandle    clipRgn;
  158.     Pattern        bkPat;
  159.     Pattern        fillPat;
  160.     Point        pnLoc;
  161.     Point        pnSize;
  162.     int            pnMode;
  163.     Pattern        pnPat;
  164.     int            pnVis;
  165.     int            txFont;
  166.     Style        txFace;
  167.     int            txMode;
  168.     int            txSize;
  169.     long        spExtra;
  170.     long        fgColor;
  171.     long        bkColor;
  172.     int            colrBit;
  173.     int            patStretch;
  174.     QDHandle     picSave;
  175.     QDHandle     rgnSave;
  176.     QDHandle     polySave;
  177.     QDProcsPtr     grafProcs;
  178.     } GrafPort, * GrafPtr;
  179.  
  180. /*  Quickdraw global variables - defined in the MacTraps library  */
  181. extern GrafPtr    thePort;
  182. extern Pattern    white;
  183. extern Pattern    black;
  184. extern Pattern    gray;
  185. extern Pattern    ltGray;
  186. extern Pattern    dkGray;
  187. extern Cursor    arrow;
  188. extern BitMap    screenBits;
  189. extern long        randSeed;
  190.  
  191. /*  functions returning non-integral values  */
  192. pascal RgnHandle NewRgn();
  193. pascal PicHandle OpenPicture();
  194. pascal PolyHandle OpenPoly();
  195.  
  196. /*  low-memory globals  */
  197. extern int ScrVRes : 0x102;
  198. extern int ScrHRes : 0x104;
  199. extern int ScreenRow : 0x106;
  200. extern long RndSeed : 0x156;
  201. extern Ptr ScrnBase : 0x824;
  202. extern Rect CrsrPin : 0x834;
  203.  
  204.  
  205. #endif _Quickdraw_